package paperless.main;

import paperless.information.InformationTabActivity;
import paperless.setting.SettingMain;
import android.app.ActionBar;
import android.app.FragmentTransaction;
import android.app.ActionBar.OnNavigationListener;
import android.app.Activity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;

import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Toast;

import com.example.paperless.R;


public class Main extends Activity {

		boolean isFirst = false;
		
		@Override
		public void onCreate(Bundle savedInstanceState) {
		    super.onCreate(savedInstanceState);
		    setContentView(R.layout.main_layout);
		    
		    MainTopFragment mainTopFragment = new MainTopFragment();
		    MainBottomFragment mainBottomFragment = new MainBottomFragment();
		    FragmentTransaction ft = getFragmentManager().beginTransaction();
		    ft.add(R.id.top, mainTopFragment);
		    ft.add(R.id.bottom, mainBottomFragment);
		    ft.commit();
		    		   
		}
		@Override
		public boolean onCreateOptionsMenu(Menu menu) {
			// Inflate the menu; this adds items to the action bar if it is present.
			getMenuInflater().inflate(R.menu.main, menu);
			return true;
		}
		
		@Override
		public boolean onOptionsItemSelected(MenuItem item) {
			// TODO Auto-generated method stub
			switch(item.getItemId()) {
			case R.id.menuItem :
				return true;
			case R.id.goHome :
				return true;
			case R.id.setting :
				Intent i = new Intent(Main.this, SettingMain.class);
				startActivity(i);
				return true;
			case R.id.logOut :
				Toast.makeText(this, "logOut", Toast.LENGTH_SHORT).show();
				return true;
			}
			return super.onOptionsItemSelected(item);
		}

}